<template>
  <div class="star-goods">
    <h2>{{hot.showName}}</h2>
    <div class="goods-container">
      <div class="goods-item" v-for="(item,index) in starGoods" :key="index">
        <router-link :to="'goodsDetails?productId='+item.productId">
        <img :src="item.productImgVO" alt="">
          <p class="title">{{item.productName}}</p>
        </router-link>
        <p class="text">{{item.subTitle}}</p>
        <p class="price">{{item.productPrice}}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: [
    'hot'
  ],
  data () {
    return {
      starGoods: []
    }
  },
  mounted () {
    this.starGoods = this.hot.showContent
  }
}
</script>

<style lang="scss">
.star-goods{
  width: 1226px;
  margin: 0 auto;
  margin-top: 26px;
  h2{
    font-size: 22px;
    font-weight: 200;
    line-height: 58px;
    color: #333;
  }
  .goods-container{
    height: 340px;
    width: 1226px;
    display: flex;
    justify-content: space-between;
    .goods-item{
      width: 234px;
      height: 300px;
      background: #fafafa;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      text-align: center;
      transition: all .2s linear;
      &:hover{
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        margin-top: -1px;
      }
      &:nth-child(1){
        border-top: 1px solid #ffac13;
      }
      &:nth-child(2){
        border-top: 1px solid #83c44e;
      }
      &:nth-child(3){
        border-top: 1px solid #2196f3;
      }
      &:nth-child(4){
        border-top: 1px solid #e53935;
      }
      &:nth-child(5){
        border-top: 1px solid #00c0a5;
      }
      a{
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        font-size: 14px;
        font-weight: 400;
        img{
          width: 160px;
          height: 160px;
        }
      }
      .text{
        color: #b0b0b0;
        font-size: 12px;
        margin-top: 10px;
        margin-bottom: 15px;
      }
      .price{
        color: #ff6709;
        font-size: 14px;
      }
    }
  }
}
</style>


